package cn.taoticket.service;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


import cn.taoticket.mapper.TaoticketOrderLinkUserMapper;
import cn.taoticket.pojo.TaoticketOrderLinkUser;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by taoticket
 */
@RestController
public class RestTaoticketOrderLinkUserService {

     @Resource
     private TaoticketOrderLinkUserMapper taoticketOrderLinkUserMapper;

     @RequestMapping(value = "/getTaoticketOrderLinkUserById",method = RequestMethod.POST)
     public TaoticketOrderLinkUser getTaoticketOrderLinkUserById(@RequestParam("id") Long id)throws Exception{
        return taoticketOrderLinkUserMapper.getTaoticketOrderLinkUserById(id);
     }

     @RequestMapping(value = "/getTaoticketOrderLinkUserListByMap",method = RequestMethod.POST)
     public List<TaoticketOrderLinkUser>	getTaoticketOrderLinkUserListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketOrderLinkUserMapper.getTaoticketOrderLinkUserListByMap(param);
     }

     @RequestMapping(value = "/getTaoticketOrderLinkUserCountByMap",method = RequestMethod.POST)
     public Integer getTaoticketOrderLinkUserCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketOrderLinkUserMapper.getTaoticketOrderLinkUserCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddTaoticketOrderLinkUser",method = RequestMethod.POST)
     public Integer qdtxAddTaoticketOrderLinkUser(@RequestBody TaoticketOrderLinkUser taoticketOrderLinkUser)throws Exception{
        taoticketOrderLinkUser.setCreatedTime(new Date());
        return taoticketOrderLinkUserMapper.insertTaoticketOrderLinkUser(taoticketOrderLinkUser);
     }

     @RequestMapping(value = "/qdtxModifyTaoticketOrderLinkUser",method = RequestMethod.POST)
     public Integer qdtxModifyTaoticketOrderLinkUser(@RequestBody TaoticketOrderLinkUser taoticketOrderLinkUser)throws Exception{
        taoticketOrderLinkUser.setUpdatedTime(new Date().getTime());//这里改过参数
        return taoticketOrderLinkUserMapper.updateTaoticketOrderLinkUser(taoticketOrderLinkUser);
     }
}
